package com.yc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

/**
 * Hello world!
 */
@Repository
public class App {
    @Autowired
    private CacheManager cacheManager;

    public static void main(String[] args) {
        App app = new App();
        app.printCacheContent("users", 1);
    }

    public void printCacheContent(String cacheName, Object key) {
        Cache cache = cacheManager.getCache(cacheName);
        if (cache != null) {
            Cache.ValueWrapper valueWrapper = cache.get(key);
        }
    }
}
